package com.mx.cofee;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class Element {

	private Block block;
	private LinkedList<Block> horizontal;
	private LinkedList<Block> vertical;
	private List<Block> removeList;

	public Element(Block block) {
		this.block = block;		
		horizontal = new LinkedList<Block>();
		vertical = new LinkedList<Block>();
		removeList = new ArrayList<Block>();
	}

	public Block getBlock() {
		return block;
	}

	public void addToRight(Block block) {		
		horizontal.add(block);		
	}

	public void addToLeft(Block block) {		
		horizontal.push(block);
	}
	
	public void addToDown(Block block){
		vertical.add(block);
		System.out.println("CANDIDATE " + this.block +"DOWN " + block + " - " + vertical);
	}
	
	public void addToUp(Block block){
		vertical.push(block);
		System.out.println("CANDIDATE " + this.block +"UP " + block + " - " + vertical);
	}

	public List<Block> getHBlocks() {
		return horizontal;
	}
	
	public List<Block> getVBlocks() {
		return vertical;
	}

	public String toString() {
		return block.toString();
	}
		
	public void setBlock(Block block){
		this.block = block;
	}
}
